package com.xinghou.platform.server.api.controller;

import com.xinghou.platform.model.main.BackGroundUser;
import com.xinghou.platform.server.api.service.BackGroundService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

/**
 * Created by liufangyu on 16/7/29.
 */
@Controller
@SessionAttributes("token")
public class BackGroundController extends  BaseControl {
    @Resource
    public BackGroundService backGroundService;

    /**
     * 话题列表
     * @param user
     * @param request
     * @param response
     * @return
     */
    @ResponseBody
    @RequestMapping(value="/background/login",method = {RequestMethod.POST})
    public String login( @RequestBody BackGroundUser user,
                               HttpServletRequest request, HttpServletResponse response)
    {
        BackGroundUser  backGroundUser=backGroundService.login(user);
        return response(backGroundUser);

    }



}
